{% extends "base.html" %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--微信发送记录{% endblock %}

{% block panel_heading %}
  万屏时代OPC--微信发送记录
{% endblock %}

{% block panel_body %}
    <form id="search-form" action="{{ url_for('opc_wechat_bp.wechat_log_list') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.user_mobile, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.user_nickname, div_col=4, label_col=4, field_col=7) }}
        <div class="form-group col-xs-4">
            <button type="submit" class="btn btn-info"
                    id="experience-visit-query-btn">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'opc_wechat_bp.wechat_log_list', **url_kwargs) }}
    </div>
    {% endif %}

    <table id="sms-log-table" class="table table-bordered table-hover table-condensed table-striped table-responsive">
        <thead>
            <tr>
                <th>用户ID</th>
                <th>用户昵称</th>
                <th>用户手机</th>
                <th>微信openid</th>
                <th>模板代码</th>
                <th style="width: 400px">发送数据</th>
                <th>发送时间</th>
            </tr>
        </thead>
        <tbody>
            {% for log in logs %}
            <tr>
                <td>{{ log.user_id }}</td>
                <td>{{ log.user_nickname }}</td>
                <td>{{ log.user_mobile | encrypt }}</td>
                <td>{{ log.openid }}</td>
                <td>{{ log.code }}</td>
                <td style="width: 400px; display: block; overflow: auto; height: 280px;">{{ log.content }}</td>
                <td>{{ log.created_datetime }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>


    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'opc_wechat_bp.wechat_log_list', **url_kwargs) }}
    </div>
    {% endif %}
{% endblock %}
